<?php 
	session_start();
	require_once ($_SERVER['DOCUMENT_ROOT']."/control/Utils.php");
	if ( isset($_SESSION["matvv"]) ){
		URL_forward("/Main.php", "5");
		exit();
	}
?>
<HTML>
<HEAD>
<TITLE>TruAge Register Panel</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<SCRIPT language="JavaScript" src="scripts/global_functions.js"></SCRIPT>
<SCRIPT language="JavaScript" src="md5.js"></SCRIPT>
<SCRIPT language="JavaScript">
var mhex_chr = "0123456789abcdef";
function mhex(num) {
	str = mhex_chr.charAt((num >> 4) & 0x0F) + mhex_chr.charAt(num & 0x0F);
	return str;
}
function makepass() {
	p = calcMD5(document.forms[0].pass.value);
	t = '<?print md5($ts)?>';
	ap = new Array(16);
	at = new Array(16);
	vt = new Array(16);
	v = "";
	for (i=0; i<16; i++) {
		ap[i] = parseInt('0x' + p.charAt(2*i) + p.charAt(2*i+1));
		at[i] = parseInt('0x' + t.charAt(2*i) + t.charAt(2*i+1));
		vt[i] = ap[i] ^ at[i];
		v += mhex(vt[i]);
	}
	document.forms[0].pass.value=v;
}
</SCRIPT>
<LINK href="stylesheet/main.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY bgcolor="#C1CCCE" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="doOnload();">
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0" align="left" height="100%">
  <FORM method="post" action="control/authorization.php">
    <TR align="center">
      <TD valign="middle" bgcolor="#BCBCBC"><TABLE width="10%"  border="0" cellpadding="5" cellspacing="1" bgcolor="#C1CCCE">
          <? if ( isset($_GET['call']) AND $_GET['call']=="invalid" )
			   {
				print("<font color='#232323' family='Arial, Helvetica, sans-serif' size='2'>\n");;
				print("Mã TVV/Mật khẩu không hợp lệ.<br>");
				print("<br><br>");
			   }
			?>
          <TR>
            <TD bgcolor="#CB9865"><TABLE width="300"  border="0" cellpadding="10" cellspacing="0">
                <TR>
                  <TD nowrap align=center><IMG src="images/truage_banner.jpg"> </TD>
                </TR>
                <TR>
                  <TD nowrap class="normal" align=center><STRONG><FONT color="#232323">Hệ thống đăng kí đo TruAge trực tuyến</FONT></STRONG><FONT color="#232323"><BR>
                    Đăng nhập</FONT></TD>
                </TR>
                <TR>
                  <TD align="center"><TABLE width="50%" border="0" cellspacing="0" cellpadding="1">
                      <TR class="normal">
                        <TD><FONT color="#232323"><STRONG>Mã TVV: </STRONG></FONT></TD>
                        <TD><INPUT name="matvv" type="text" class="formfield" size="20">
                        </TD>
                      </TR>
                      <TR class="normal">
                        <TD><FONT color="#232323"><STRONG>Mật Khẩu: </STRONG></FONT></TD>
                        <TD><INPUT name="matkhau" type="password" class="formfield" size="20">
                        </TD>
                      </TR>
                    </TABLE></TD>
                </TR>
                <TR>
                  <TD align="center"><INPUT type="submit" name="submit" value="LOGIN" class="buttonLogin" >
                  </TD>
                </TR>
              </TABLE></TD>
          </TR>
        </TABLE><br /><div align="center" style="font-size:13px">Copyright © 2013 by max5 Group<br><br>
Khi gặp vấn đề kỹ thuật hoặc các vấn đề liên quan vui lòng liên hệ: <br>
Vương Đức Long - vdlong.mlm@gmail.com - 0937553733<br>
Đậu Văn Cương - cuong.bioactive@gmail.com - 0904 773 188
</div></TD>
    </TR>
  </FORM>
</TABLE>

</BODY>
</HTML>
